package cn.conchit.apccontroldemo.graph.canvas;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author hetao
 * @version 1.0
 * @description: TODO
 * @date 2023/2/16 17:05
 */
public class CanvasExecutor {

    private CanvasGraph graph;

    public CanvasExecutor(CanvasGraph graph) {
        this.graph = graph;

        final int CORE_POOL_SIZE = graph.getNodeList().size();
        final int MAX_POOL_SIZE = graph.getNodeList().size();
        final int QUEUE_CAPACITY = 0;
        final Long KEEP_ALIVE_TIME = 1L;

        ThreadPoolExecutor executor = new ThreadPoolExecutor(
                CORE_POOL_SIZE,
                MAX_POOL_SIZE,
                KEEP_ALIVE_TIME,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(QUEUE_CAPACITY),
                new ThreadPoolExecutor.CallerRunsPolicy());
    }

    public void execute() {

    }





}
